package com.buaa.aimall.computeModule.Entity;

import com.baomidou.mybatisplus.annotation.*;
import com.buaa.aimall.computeModule.Enum.ComputeRatingEnum;
import com.buaa.aimall.computeModule.Enum.ComputeStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;

import java.time.LocalDateTime;

@TableName(value = "compute")
@FieldNameConstants
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ComputeEntity {
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    @TableField("name")
    private String name;

    @TableField("fk_creator")
    private String creator;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    @TableLogic
    @TableField("del_flag")
    private Integer delFlag;

    @TableField("description")
    private String description;

    @TableField("type")
    private String type;

    @TableField("price_by_hour")
    private Integer priceByHour;

    @TableField("price_by_day")
    private Integer priceByDay;

    @TableField("price_by_week")
    private Integer priceByWeek;

    @TableField("price_by_month")
    private Integer priceByMonth;

    @TableField("is_enable")
    private Boolean isEnable;

    @TableField("doc_url")
    private String docURL;

    @TableField("status")
    private ComputeStatusEnum status;

    @TableField("memory_size")
    private int memorySize;

    @TableField("rating")
    private ComputeRatingEnum rating;

    @TableField("cpu_num")
    private Integer cpuNumber;

    @TableField("vgpu_num")
    private Integer gpuNumber;

    @TableField("cpuid")
    private String cpuid;

    @TableField("gpuid")
    private String gpuid;

    @TableField("source")
    private String source;

    @TableField("is_custom")
    private Boolean isCustom;

    @TableField(exist = false)
    private Boolean isCollected;
}
